package com.htl.io.缓冲流;

import java.io.*;

/**
 *  字符输入缓冲流 BufferedReader
 */

public class BufferedReader__test {
    public static void main(String[] args) {
        BufferedReader bufferedReader = null;
        Reader reader = null;

        try {
            reader = new FileReader("D:\\Project\\IDEA_project\\java_note\\src\\com\\htl\\io\\缓冲流\\test.txt");
            bufferedReader = new BufferedReader(reader);
            String str = "";
            /**
             *  readLine() : 按行去读
             */
            while (((str = bufferedReader.readLine()) != null)) {
                System.out.println(str);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                reader.close();
                bufferedReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
